<template>
  <div class="container">
    <!-- 面包屑导航 -->
    <div class="breadcrumb">
      <el-breadcrumb separator="">
        <el-breadcrumb-item>
          <div class="div1">客户管理</div>
        </el-breadcrumb-item>
        <el-breadcrumb-item v-if="isChange == 0" :to="{ path: '/myCustomers' }">
          <div class="div3">我的客户</div>
        </el-breadcrumb-item>
        <el-breadcrumb-item
          :to="{ name: 'customerInformation', query: { id: this.customerId } }"
        >
          <div class="div3">客户资料</div>
        </el-breadcrumb-item>
        <el-breadcrumb-item
          v-if="isChange == 0"
          :to="{
            name: 'add_order',
            query: {
              userId: this.customerId,
              pingZ: this.pingZ,
              receivedMoney: this.receivedMoney,
              total: this.total,
              userIntention: this.form.userIntention,
              userDitch: this.form.userDitch,
              channelOrderId: this.channelOrderId,
            },
          }"
        >
          <div class="div3">添加订单</div>
        </el-breadcrumb-item>
        <el-breadcrumb-item
          v-if="isChange == 1 && !$route.query.isCommit"
          :to="{
            name: 'fixOrder',
            query: {
              customerId: this.customerId,
              taskId: this.taskId,
              addressId: this.addressId,
              total: this.total,
              orderId: this.orderId,
              receivedMoney: this.receivedMoney,
              userIntention: this.form.userIntention,
              userDitch: this.form.userDitch,
            },
          }"
        >
          <div class="div3">修改订单</div>
        </el-breadcrumb-item>
        <el-breadcrumb-item
          v-if="isChange == 1 && $route.query.isCommit == 2"
          :to="{
            name: 'wyUpdate',
            query: {
              customerId: this.customerId,
              taskId: this.taskId,
              addressId: this.addressId,
              total: this.total,
              orderId: this.orderId,
              receivedMoney: this.receivedMoney,
              userIntention: this.form.userIntention,
              userDitch: this.form.userDitch,
            },
          }"
        >
          <div class="div3">修改订单</div>
        </el-breadcrumb-item>
        <el-breadcrumb-item>
          <div class="div2">审核订单</div>
        </el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <!-- 面包屑导航 -->

    <div class="content page-title">
      <h2>提交订单</h2>
    </div>
      <div class="step">
      <!-- stepsData.active -->
      <el-steps :active="2" align-center>
        <el-step :title="item" v-for="item in stepsData.list"></el-step>
      </el-steps>
    </div>
    <div class="basic">
      <!-- <div class="infoShow">
        <el-popover placement="right" width="400" trigger="click">
          <img slot="reference" src="../../assets/jil.png" alt="" />
        </el-popover>
      </div> -->

      <el-collapse-transition>
        <div class="content" v-show="!show3">
          <el-form ref="form" :inline="true" :model="form" label-width="80px">
            <el-form-item label="入线方式">
              <el-select
                v-model="form.Incoming"
                placeholder="选择入线方式"
                clearable
                filterable
                disabled
              >
                <el-option
                  v-for="items in line"
                  :key="items.id"
                  :label="items.name"
                  :value="items.id"
                ></el-option>
              </el-select>
            </el-form-item>

            <el-form-item label="入线时间">
              <el-date-picker
                style="width: 200px"
                v-model="form.ditchTime"
                placeholder="选择入线时间"
                type="date"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                disabled
              >
              </el-date-picker>
            </el-form-item>

            <el-form-item label="购买次数">
              <el-input
                v-model="form.buyNumber"
                placeholder="请输入客户购买次数"
                disabled
              ></el-input>
            </el-form-item>

            <el-form-item label="客户意向">
              <el-select v-model="form.intention" placeholder="选择客户意向">
                <el-option
                  v-for="items in intention"
                  :key="items.dictId"
                  :label="items.dictName"
                  :value="items.dictId"
                ></el-option>
              </el-select>
            </el-form-item>

            <el-form-item label="客户等级">
              <el-select
                v-model="form.category"
                placeholder="选择客户等级"
                disabled
              >
                <el-option
                  v-for="items in rank"
                  :key="items.id"
                  :label="items.name"
                  :value="items.id"
                ></el-option>
              </el-select>
            </el-form-item>

            <el-form-item label="客户姓名">
              <el-input
                v-model="form.name"
                placeholder="请输入客户姓名"
                disabled
              ></el-input>
            </el-form-item>

            <el-form-item label="客户性别">
              <el-select v-model="form.sex" placeholder="选择性别" disabled>
                <el-option label="男" value="1"></el-option>
                <el-option label="女" value="2"></el-option>
              </el-select>
            </el-form-item>

            <el-form-item label="客户年龄">
              <el-input
                type="number"
                v-model="form.age"
                placeholder="请输入客户年龄"
                disabled
              ></el-input>
            </el-form-item>

            <el-form-item label="联系电话">
              <el-input
                v-model="form.phone1"
                placeholder="请输入客户电话"
                disabled
              ></el-input>
            </el-form-item>

            <el-form-item label="联系二">
              <el-input
                v-model="form.phone2"
                placeholder="请输入客户电话"
                disabled
              ></el-input>
            </el-form-item>
          </el-form>
        </div>
      </el-collapse-transition>
    </div>

    <div class="receipt">
      <div class="header">
        <span>选择收货地址</span>
        <!-- <p v-if="!show3" @click="show3 = true">收起</p>
        <p v-if="show3" @click="show3 = false">展开</p> -->
      </div>
      <div class="determination" v-if="!temporary">
        <el-form
          ref="address"
          :inline="true"
          :model="address"
          label-width="100px"
        >
          <el-form-item label="收货人姓名">
            <el-input
              v-model="address.name"
              placeholder="请输入客户姓名"
            ></el-input>
          </el-form-item>

          <el-form-item label="联系电话">
            <div class="input1">
              <el-input
                v-model="address.phone"
                placeholder="请输入收货电话"
              ></el-input>

              <el-input
                v-show="inputIf"
                v-model="address.phone2"
                placeholder="请输入收货电话2"
              ></el-input>
              <!--"+"  v-if='!inputIf' -->
              <!-- <i class='el-icon-circle-plus-outline' style='font-size:18px;color:#999;' v-if='!inputIf' @click='inputIf=true'></i>  -->
              <!-- "-" v-else -->
              <!-- <i class='el-icon-remove-outline' style='font-size:18px;color:#999;' v-else @click='inputIf=false;address.phone2=""'></i> -->
            </div>
          </el-form-item>

          <el-form-item label="收货地址">
            <levelAddr
              class="addressContent"
              :province="address.province"
              :city="address.city"
              :area="address.area"
              @updateprovice="getProvince"
              @updatecity="getCity"
              @updatearea="getArea"
            ></levelAddr>
          </el-form-item>

          <el-form-item label="详细地址">
            <el-input
              class="address"
              v-model="address.datail"
              @blur="getAddObj()"
              @keydown.enter.native="getAddObj()"
              placeholder="请输入客户详细地址"
            ></el-input>
          </el-form-item>

          <el-form-item>
            <el-button
              size="mini"
              v-if="alter && temporary"
              @click="temporary = true"
              >取消</el-button
            >
            <el-button size="mini" type="primary" @click="add_Addresss"
              >新增到地址库</el-button
            >
          </el-form-item>
        </el-form>
      </div>
      <!-- 提交地址 -->
      <div class="submitAddress" v-if="alter && temporary">
        <p>
          <svg
            t="1610611479340"
            class="icon"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="21176"
            width="22"
            height="22"
          >
            <path
              d="M896 832c-32-57.6-70.4-96-140.8-115.2-44.8-12.8-89.6-38.4-128-70.4-32-25.6-38.4-44.8-12.8-83.2 32-51.2 64-108.8 70.4-172.8 12.8-96-6.4-217.6-140.8-256-25.6 0-44.8-6.4-76.8 6.4-134.4 51.2-147.2 192-115.2 313.6 12.8 44.8 38.4 83.2 64 115.2 19.2 32 12.8 51.2-12.8 70.4-38.4 38.4-83.2 64-134.4 76.8-64 19.2-108.8 57.6-140.8 115.2-12.8 51.2 6.4 64 57.6 64 217.6-6.4 428.8-6.4 646.4 0 51.2-6.4 70.4-19.2 64-64z"
              fill="#cdcdcd"
              p-id="21177"
            ></path>
          </svg>
          <span>{{ referaddress.userName }}</span>
          <svg
            t="1610611642756"
            class="icon"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="22555"
            width="22"
            height="22"
          >
            <path
              d="M587.491556 646.485333l19.512888-11.776c7.623111-4.494222 13.937778-7.850667 20.195556-10.581333 44.316444-19.626667 83.342222-5.745778 134.940444 52.906667 31.971556 36.295111 41.415111 68.551111 29.070223 97.28-9.159111 21.390222-26.851556 36.181333-58.368 54.499555-2.048 1.137778-20.195556 11.377778-24.860445 14.222222-73.329778 43.975111-241.379556-56.718222-362.268444-228.864-121.173333-172.544-152.576-356.522667-78.279111-401.180444l9.841777-6.030222 10.638223-6.712889c37.546667-23.665778 61.610667-33.109333 90.112-28.444445 28.501333 4.778667 52.736 25.258667 73.216 62.577778 43.235556 78.961778 33.678222 116.394667-21.902223 150.414222-3.982222 2.503111-18.204444 10.808889-19.512888 11.662223-13.653333 8.192 9.443556 63.146667 63.089777 139.491555 54.272 77.198222 99.669333 119.466667 114.517334 110.535111z"
              fill="#cdcdcd"
              p-id="22556"
            ></path>
          </svg>
          <span> {{ referaddress.phone }}</span>
          <svg
            t="1610611888850"
            class="icon"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="28154"
            width="23"
            height="23"
          >
            <path
              d="M512 187.847111c-149.276444 0-270.279111 121.742222-270.279111 271.928889 0 75.036444 30.264889 142.961778 79.132444 192.227556L512 844.231111l191.146667-192.284444a271.872 271.872 0 0 0 79.132444-192.284445c0-150.186667-121.002667-271.872-270.279111-271.872z m0 392.704A120.490667 120.490667 0 0 1 391.850667 459.662222 120.433778 120.433778 0 0 1 512 338.887111a120.490667 120.490667 0 0 1 120.149333 120.888889A120.433778 120.433778 0 0 1 512 580.551111z"
              fill="#cdcdcd"
              p-id="28155"
            ></path>
          </svg>
          <span> {{ referaddress.address }}</span>
          <span> {{ referaddress.detailedAddress }}</span>
          <el-tag
            style="margin-left: 10px"
            v-if="referaddress.isDefault == 1"
            type="primary"
            size="mini"
            >默认收货地址</el-tag
          >
          <el-tag
            v-if="referaddress.userName"
            style="margin-left: 10px"
            type="danger"
            size="mini"
            @click="addressHiddenEvent(referaddress)"
            >编辑</el-tag
          >
        </p>

        <p class="lingshi">
          <span
            @click="
              alter = false;
              temporary = true;
            "
            >更改</span
          >
          <!-- addresslistAxios(); -->
          <span @click="temporary = false">使用临时地址</span>
        </p>
      </div>
      <!-- 提交地址 -->
      <!-- 收货地址列表 -->
      <div class="addList" v-if="!alter && temporary">
        <el-radio-group v-model="radioAddress">
          <div
            style="
              display: flex;
              justify-content: space-between;
              align-items: center;
              padding: 10px 0;
              border-bottom: 1px solid #d9d9d9;
            "
            v-for="items in hereContent"
            :key="items.id"
          >
            <el-radio :label="items.id" @change="useAddress(items)">
              <div class="radioCont">
                <div>
                  <span>{{ items.userName }}</span>
                  <span> {{ items.phone }}</span>
                  <span> {{ items.address }}</span>
                  <span> {{ items.detailedAddress }}</span>
                  <el-tag
                    style="margin-left: 10px"
                    v-if="items.isDefault == 1"
                    type="primary"
                    size="mini"
                    >默认收货地址</el-tag
                  >
                </div>
              </div>
            </el-radio>
            <p
              style="width: 80px; text-align: center"
              @click="addressHiddenEvent(items)"
            >
              编辑
            </p>
          </div>
        </el-radio-group>
        <el-button style="margin-top: 10px" size="mini" @click="alter = true"
          >取消</el-button
        >
      </div>
      <!-- 收货地址列表 -->
    </div>
    <!-- 分配用户列表 -->
    <div class="orderBox">
      <div class="order">
        <p class="header" style="background: #fff; padding: 10px">订单商品</p>
        <el-table :data="tableData" style="width: 100%">
          <el-table-column label="商品名称">
            <template slot-scope="scope">
              <p>{{ scope.row.title }}</p>
            </template>
          </el-table-column>
          <el-table-column label="商品数量">
            <template slot-scope="scope">
              <div class="numer">
                <span>{{ scope.row.number }}</span>
              </div>
            </template>
          </el-table-column>
          <el-table-column label="商品单价">
            <template slot-scope="scope">
              <p>{{ scope.row.sellPrice }}</p>
            </template>
          </el-table-column>
          <el-table-column prop="brandId" label="商品品牌"></el-table-column>
          <el-table-column prop="typeId" label="商品分类"></el-table-column>
          <el-table-column
            prop="specificationName"
            label="商品规格"
          ></el-table-column>
          <el-table-column prop="total" label="商品小计"></el-table-column>
        </el-table>
        <!-- 赠品列表 -->
        <el-table :data="tableZp" style="width: 100%">
          <el-table-column label="赠品名称">
            <template slot-scope="scope">
              <p>{{ scope.row.title }}</p>
            </template>
          </el-table-column>
          <el-table-column label="赠品数量">
            <template slot-scope="scope">
              <div class="numer">
                <span>{{ scope.row.number }}</span>
              </div>
            </template>
          </el-table-column>
          <el-table-column label="赠品单价">
            <template slot-scope="scope">
              <p>{{ scope.row.sellPrice }}</p>
            </template>
          </el-table-column>
          <el-table-column prop="brandId" label="赠品品牌"> </el-table-column>
          <el-table-column prop="categoryId" label="赠品分类">
          </el-table-column>
          <el-table-column
            prop="specificationName"
            label="赠品规格"
          ></el-table-column>
          <el-table-column prop="total" label="赠品小计"></el-table-column>
        </el-table>
      </div>
      <div class="page1">
        <p>
          <span>总计：共 {{ orderNumber }} 件 </span>
        </p>
        <p><span>运费：0 </span></p>
        <p>
          <span
            >赠品总价：<span v-if="!is_null(giftPrice)">{{ giftPrice }}</span>
            <span v-if="is_null(giftPrice)">0</span> 元</span
          >
        </p>
        <p>
          <span>总价:</span>
          <el-input v-model="total" disabled></el-input>
        </p>
        <p>
          <span>已收款:</span>
          <el-input v-model="receivedMoney" disabled></el-input>
        </p>
        <p>
          <span style="color: #999">原总价：{{ origTotal }}</span>
        </p>
        <p
          v-if="
            parArray.indexOf('jlSign') != -1 &&
            position != 'manager' &&
            !$route.query.isCommit
          "
        >
          <span>经理签字：</span>
          <el-radio-group
            v-model="isManager"
            :disabled="isManagerDefault"
            style="margin-top: 3px"
          >
            <el-radio :label="0">否</el-radio>
            <el-radio :label="1">是</el-radio>
          </el-radio-group>
        </p>
        <p v-if="isChange == 0">
          <el-button
            style="margin-left: 30px"
            type="primary"
            size="small"
            @click="toReviewOrder()"
            >提交订单</el-button
          >
        </p>
        <p v-if="isChange == 1">
          <el-button
            style="margin-left: 30px"
            type="primary"
            size="small"
            @click="trueOrderTips"
            >确定提交</el-button
          >
        </p>
      </div>
    </div>
    <!-- 分配用户列表 -->
    <!-- 订单备注 -->
    <div class="orderNotes">
      <div class="header">
        <span>订单备注</span>
      </div>
      <div class="notes">
        <el-input
          type="textarea"
          v-model="textarea"
          disabled
          placeholder="备注"
        ></el-input>
        <p v-for="(item, index) in fileList" :key="index">
          <img
            v-if="!is_null(fileList)"
            v-image-preview
            :src="ImgHttps + item.img"
            class="avatar"
          />
        </p>
      </div>
    </div>

    <!-- 地址编辑弹框 -->
    <el-dialog
      :visible.sync="addressHidden"
      :append-to-body="true"
      title="编辑地址"
    >
      <el-form
        ref="address"
        label-position="right"
        :model="addressDialog"
        label-width="100px"
      >
        <el-form-item label="收货人姓名">
          <el-input
            v-model="addressDialog.name"
            placeholder="请输入客户姓名"
          ></el-input>
        </el-form-item>

        <el-form-item label="联系电话">
          <el-input
            v-model="addressDialog.phone"
            placeholder="请输入收货电话"
          ></el-input>
        </el-form-item>

        <el-form-item label="收货地址">
          <levelAddr
            class="addressContent"
            :province="addressDialog.province"
            :city="addressDialog.city"
            :area="addressDialog.area"
            @updateprovice="getProvince1"
            @updatecity="getCity1"
            @updatearea="getArea1"
          ></levelAddr>
        </el-form-item>

        <el-form-item label="详细地址">
          <el-input
            class="address"
            v-model="addressDialog.datail"
            @blur="getAddObj1()"
            @keydown.enter.native="getAddObj1()"
            placeholder="请输入客户详细地址"
          ></el-input>
        </el-form-item>
        <div>
          <el-form-item>
            <el-checkbox
              :true-label="1"
              :false-label="0"
              v-model="addressDialog.isDefault"
              >默认收获地址</el-checkbox
            >
            <!-- @change="setdefault" -->
          </el-form-item>
        </div>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" type="primary" @click="editSussess()"
          >确 定</el-button
        >
        <el-button size="mini" @click="addressHidden = false">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 地址编辑弹框 -->
  </div>
</template>

<script>
import levelAddr from '@/components/levelAddr'
import $ from 'jquery'
export default {
  components: {
    levelAddr
  },
  data () {
    return {
      show3: false,
      radioAddress: '',
      hereContent: [],
      addressHidden: false,
      alter: true, // 更改地址判断
      origTotal: 0,
      orderNumber: 0,
      form: {
        Incoming: '',
        ditchTime: '',
        intention: '',
        category: '',
        service: '',
        name: '',
        phone1: '',
        phone2: '',
        timer: '',
        address: '',
        province: '',
        city: '',
        area: '',
        sex: '',
        age: '',
        buyNumber: ''
      },
      id: '',
      referaddress: '',
      address: {
        // 临时地址
        name: '',
        phone: '',
        province: '',
        city: '',
        area: '',
        datail: '',
        addressId: '',
        isDefault: ''
      },
      temporary: true, // 临时地址判断
      addressDialog: {
        name: '',
        phone: '',
        province: '',
        city: '',
        area: '',
        datail: '',
        addressId: '',
        isDefault: ''
      },
      inputIf: false,
      date: '',
      total: 0,
      giftPrice: 0,
      receivedMoney: 0, // 已收金额
      tableData: [],
      tableZp: [],
      // 接收数据
      line: [],
      intention: [],
      rank: [],
      customer: [],
      isChange: 0, // 0正常单
      taskId: '',
      customerId: '',
      fileList: [],
      voucher: [],
      textarea: '',
      addressId: '',
      orderId: '',
      isManager: 0,
      isManagerDefault: false,
      pingZ: false, // 判断用户是否从客户列表进
      limits: '',
      parArray: [],
      channelOrderId: '',
      position: sessionStorage.getItem('positionCode'),

      stepsData: {
        active: 0,
        list: ['选购商品', '提交订单', '支付订单', '提交审核']
      }
    }
  },
  created () {
    // 权限设定判断
    this.limits = JSON.parse(sessionStorage.getItem('limit'))
    const params = this.limits.buttonTreeDto.filter(
      (item) => item.menuCode === 'orderListCode'
    )
    params[0].buttonList.forEach((item) => {
      this.parArray.push(item.code)
    })
    // 权限设定判断

    this.taskId = this.$route.query.taskId
    this.customerId = this.$route.query.customerId
    this.orderId = this.$route.query.orderId
    this.receivedMoney = this.$route.query.receivedMoney
    this.total = this.$route.query.total
    if (this.$route.query.channelOrderId) {
      this.channelOrderId = this.$route.query.channelOrderId
    }
    if (Number(this.receivedMoney) < Number(this.total)) {
      this.isManager = 1 // 未付全额默认提交给经理
      this.isManagerDefault = true
    } else {
      this.isManager = 0
      this.isManagerDefault = false
    }
    if (this.$route.query.isManager != undefined) {
      this.isManager = this.$route.query.isManager
      this.isManagerDefault = true
    }
    this.giftPrice = this.$route.query.giftPrice
    // this.addressId = this.$route.query.addressId;
    // 判断是否改单 //

    this.isChange = this.$route.query.isChange
    // console.log(this.isChange+"----this.isChange")
    if (this.is_null(this.isChange)) {
      this.isChange = 0
      this.localization()
    } else if (this.isChange == 1) {
      const addressContent = this.$route.query.address
      // this.alter=false;
      this.temporary = false
      this.address = {
        name: addressContent.name,
        phone: addressContent.phone,
        province: addressContent.province,
        city: addressContent.city,
        area: addressContent.area,
        datail: addressContent.datail
      }
    }
    this.pingZ = this.$route.query.pingZ
    // console.log(this.pingZ+"--this.pingZ");
    if (!this.is_null(this.pingZ)) {
      this.pingZ = true
    }
    this.detailAxios()
    this.commentAxios()
    this.customerlist()
    this.addresslistAxios()

    // this.tableData = JSON.parse(sessionStorage.getItem('goodsList'))
    // this.tableZp = JSON.parse(sessionStorage.getItem('giftList'))

    this.voucher = JSON.parse(sessionStorage.getItem('voucher'))
    if (!this.is_null(this.voucher)) {
      this.textarea = this.voucher.note
      this.fileList = this.voucher.fileImg
    }

    const zpNum = 0
    const numb = 0
    const zpPrice = 0
    const price = 0
    // for (let i = 0; i < this.tableZp.length; i++) {
    //   zpNum += this.tableZp[i].number
    //   zpPrice += this.tableZp[i].number * this.tableZp[i].sellPrice
    // }
    // for (let i = 0; i < this.tableData.length; i++) {
    //   numb += parseInt(this.tableData[i].number)
    //   price += this.tableData[i].number * this.tableData[i].sellPrice
    // }

    // this.orderNumber = parseInt(numb) + parseInt(zpNum)
    // this.origTotal = price + zpPrice
  },
  methods: {
    // 自动解析地址三级联动
    getAddObj () {
      this.address.datail = this.address.datail.replaceAll(' ', '')
      $.get(
        'http://120.24.147.235:3002/test',
        { addr: this.address.datail },
        (res) => {
          const addrObj = res.message
          if (
            this.address.datail.indexOf(
              addrObj.province + addrObj.city + addrObj.county
            ) === 0
          ) {
            this.updateAddr(addrObj)
          } else {
            var t = 0
            this.address.datail.indexOf(addrObj.province) === 0 ? t++ : (t = t)
            this.address.datail.indexOf(addrObj.city) != -1 ? t++ : (t = t)
            this.address.datail.indexOf(addrObj.county) != -1 ? t++ : (t = t)
            if (t >= 2) {
              this.updateAddr(addrObj)
            }
          }
        }
      )
    },
    updateAddr (e) {
      this.address.province = e.province
      this.address.city = e.city
      this.address.area = e.county
      this.address.datail = this.address.datail.replace(
        this.address.province,
        ''
      )
      this.address.datail = this.address.datail.replace(this.address.city, '')
      this.address.datail = this.address.datail.replace(this.address.area, '')
    },

    // 自动解析地址三级联动
    getAddObj1 () {
      this.addressDialog.datail = this.addressDialog.datail.replaceAll(' ', '')
      $.get(
        'http://120.24.147.235:3002/test',
        { addr: this.addressDialog.datail },
        (res) => {
          const addrObj = res.message
          if (
            this.addressDialog.datail.indexOf(
              addrObj.province + addrObj.city + addrObj.county
            ) === 0
          ) {
            this.updateAddr1(addrObj)
          } else {
            var t = 0
            this.addressDialog.datail.indexOf(addrObj.province) === 0
              ? t++
              : (t = t)
            this.addressDialog.datail.indexOf(addrObj.city) != -1
              ? t++
              : (t = t)
            this.addressDialog.datail.indexOf(addrObj.county) != -1
              ? t++
              : (t = t)
            if (t >= 2) {
              this.updateAddr1(addrObj)
            }
          }
        }
      )
    },
    updateAddr1 (e) {
      this.addressDialog.province = e.province
      this.addressDialog.city = e.city
      this.addressDialog.area = e.county
      this.addressDialog.datail = this.addressDialog.datail.replace(
        this.addressDialog.province,
        ''
      )
      this.addressDialog.datail = this.addressDialog.datail.replace(
        this.addressDialog.city,
        ''
      )
      this.addressDialog.datail = this.addressDialog.datail.replace(
        this.addressDialog.area,
        ''
      )
    },

    // 详情
    detailAxios () {
      this.axios
        .get('/order/comm/customeruser/selectById?id=' + this.customerId)
        .then((res) => {
          // console.log("详情");
          console.log(res.data, "this.$route.query.userIntention");
          console.log(this.$route.query.userIntention, "this.$route.query.userIntention");

          if (res.code == 0) {
            // res.data.map(item=>{
            //   item.userIntention =
            // })
            this.form = {
              Incoming: this.$route.query.userDitch
                ? this.$route.query.userDitch
                : res.data.userDitch,
              intention: this.$route.query.userIntention
                ? this.$route.query.userIntention
                : res.data.userIntention,
              category: res.data.userLevel,
              service: '', // 客服id
              name: res.data.userName,
              phone1: res.data.phone.split(',')[0],
              phone2: res.data.phone.split(',')[1],
              timer: '',
              address: res.data.detailedAddress,
              province: res.data.provinceCode,
              city: res.data.cityCode,
              area: res.data.regionCode,
              sex: res.data.gender,
              age: res.data.age,
              ditchTime: res.data.ditchTime,
              buyNumber: res.data.buyNumber
            }
          } else {
            this.$message.error(res.message)
          }
        })
    },
    // 查询收货地址
    localization () {
      this.axios
        .get('/order/order/user/selectAddress?userId=' + this.customerId, {
          headers: {
            isLoading: false
          }
        })
        .then((res) => {
          if (res.code == 0 && res.data) {
            // this.address = {
            //   name: res.data.userName,
            //   phone: res.data.phone,
            //   province: res.data.provinceCode,
            //   city: res.data.cityCode,
            //   area: res.data.regionCode,
            //   datail: res.data.detailedAddress,
            //   addressId: res.data.id,
            //   userIntention: this.form.intention,
            //   userDitch: this.form.Incoming,
            // };
            this.referaddress = res.data
          } else {
            this.temporary = false
          }
        })
    },

    /** 地址列表数据请求**/
    addresslistAxios () {
      this.axios
        .get('/order/comm/customeraddress/list?id=' + this.customerId, {
          headers: {
            isLoading: false
          }
        })
        .then((res) => {
          console.log('地址列表')
          console.log(res)
          if (res.code == 0) {
            this.hereContent = res.data
          }
        })
    },

    addressHiddenEvent (row) {
      this.addressHidden = true
      this.addressDialog = {
        name: row.userName,
        phone: row.phone,
        province: row.provinceCode,
        city: row.cityCode,
        area: row.regionCode,
        datail: row.detailedAddress,
        addressId: row.id,
        isDefault: row.isDefault
      }
    },

    // 保存修改地址
    editSussess: _.debounce(function () {
      if (this.addressDialog.name == '') {
        this.$message.warning('收货人未填')
      } else if (this.addressDialog.phone == '') {
        this.$message.warning('联系电话未填')
      } else if (
        this.addressDialog.province == '' ||
        this.addressDialog.city == '' ||
        this.addressDialog.province == null ||
        this.addressDialog.city == null
      ) {
        this.$message.warning('省-市未填')
      } else if (this.addressDialog.datail == '') {
        this.$message.warning('详细地址未填')
      } else {
        this.axios
          .post(
            '/order/comm/customeraddress/update',
            {
              address:
                this.addressDialog.province +
                this.addressDialog.city +
                this.addressDialog.area,
              cityCode: this.addressDialog.city,
              createdBy: sessionStorage.getItem('user_id'),
              customerId: '',
              detailedAddress: this.addressDialog.datail,
              id: this.addressDialog.addressId,
              isDefault: this.addressDialog.isDefault,
              phone: this.addressDialog.phone,
              provinceCode: this.addressDialog.province,
              regionCode: this.addressDialog.area,
              userName: this.addressDialog.name,
              userId: this.customerId
            },
            {
              headers: {
                isLoading: false
              }
            }
          )
          .then((res) => {
            // console.log(res);
            if (res.code == 0) {
              this.addresslistAxios()
              this.localization()
              this.addressHidden = false
              // this.$message.success("修改成功");
            } else {
              this.$message.error(res.message)
            }
          })
      }
    }, 300),

    /** 使用地址**/
    useAddress (row) {
      this.axios
        .get(
          '/order/comm/customeraddress/updateAddress?addressId=' +
          row.id +
          '&userId=' +
          this.customerId,
          {
            headers: {
              isLoading: false
            }
          }
        )
        .then((res) => {
          // console.log(res)
          if (res.code == 0) {
            this.alter = true
            this.localization()
          } else {
            this.$message.error(res.message)
          }
        })
    },
    //* * 添加地址 **//
    add_Addresss: _.debounce(function () {
      if (this.address.name == '') {
        this.$message.warning('收货人未填')
      } else if (
        this.address.phone == '' ||
        !this.judgeIsNum(this.address.phone)
      ) {
        this.$message.warning('联系电话有误')
      } else if (this.address.province == '' || this.address.city == '') {
        this.$message.warning('省-市未填')
      } else if (this.address.datail == '') {
        this.$message.warning('详细地址未填')
      } else {
        for (const i in this.hereContent) {
          if (
            this.hereContent[i].userName == this.address.name &&
            this.hereContent[i].phone == this.address.phone &&
            this.hereContent[i].provinceCode == this.address.province &&
            this.hereContent[i].cityCode == this.address.city &&
            this.hereContent[i].regionCode == this.address.area &&
            this.hereContent[i].detailedAddress == this.address.datail
          ) {
            this.$message.warning('该地址已存在地址列表')
            return
          }
        }

        this.axios
          .post(
            '/order/comm/customeraddress/add',
            {
              address:
                this.address.province + this.address.city + this.address.area,
              cityCode: this.address.city,
              createdBy: sessionStorage.getItem('user_id'),
              customerId: '',
              detailedAddress: this.address.datail,
              id: '',
              isDefault: 0,
              phone: this.address.phone,
              provinceCode: this.address.province,
              regionCode: this.address.area,
              userName: this.address.name,
              userId: this.customerId
            },
            {
              headers: {
                isLoading: false
              }
            }
          )
          .then((res) => {
            // console.log(res);
            if (res.code == 0) {
              this.addresslistAxios()

              if (this.hereContent.length == 1) {
                this.localization()
              }
              this.$message.success('保存成功')
            } else {
              this.$message.error(res.message)
            }
          })
      }
    }, 500),
    //* * 添加地址 **//
    /** 地址列表数据请求**/

    // 客户下拉框数据
    customerlist () {
      this.axios
        .get(
          "/sys/v1/user/employee/by/sales/authority?salesAuthorityId=" +
          JSON.parse(sessionStorage.getItem("salesAuthorityId").split(",")),
          {
            headers: {
              isLoading: false
            }
          }
        )
        .then((res) => {
          // console.log(res);
          if (res.code == 0) {
            this.customer = res.data
          } else {
            this.$message.error(res.message)
          }
        })
    },
    toReviewOrder: _.debounce(function () {
      console.log(this.intention, "this.intention")
      if (
        JSON.parse(sessionStorage.getItem('salesAuthorityId').split(',')) == '1'
      ) {
        this.$confirm(
          "客户意向：" +
          this.intention.find((res) => res.id == this.form.intention).name,
          "请确认您的订单信息",
          {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }
        )
          .then(() => {
            this.dataList()
          })
          .catch(() => {
            this.$message({
              type: 'info',
              message: '已取消提交'
            })
          })
      } else {
        console.log('进来这里了')
        this.dataList()
      }
    }, 300),

    dataList () {
      this.getAddObj()
      const goods = []

      for (let i = 0; i < this.tableData.length; i++) {
        const content = {
          commodityId: this.tableData[i].id,
          createdBy: sessionStorage.getItem('user_id'),
          createdTime: '',
          number: Number(this.tableData[i].number),
          orderId: '',
          sellPrice: this.tableData[i].sellPrice,
          total: this.tableData[i].total
        }
        goods.push(content)
      }
      // 赠品列表
      const gift = []
      if (!this.is_null(this.tableZp)) {
        for (let i = 0; i < this.tableZp.length; i++) {
          const contentGift = {
            complimentaryId: this.tableZp[i].id,
            createdBy: sessionStorage.getItem('user_id'),
            createdTime: '',
            number: Number(this.tableZp[i].number),
            orderId: '',
            sellPrice: this.tableZp[i].sellPrice,
            total: this.tableZp[i].total
          }
          gift.push(contentGift)
        }
      }

      // let addressClass = false;
      // if (
      //   (this.address.phone2 &&
      //     this.address.phone2.length == 11 &&
      //     this.judgeIsNum(this.address.phone2)) ||
      //   this.address.phone2 == null ||
      //   (this.address.phone2 && this.address.phone2.length == 0)
      // ) {
      //   addressClass = true;
      // }
      // 地址选择处理
      let addressInfo = {
        name: '',
        phone: '',
        datail: '',
        province: '',
        city: '',
        area: '',
        datail: ''
      }

      let addressPhone = ''

      if (!this.temporary) {
        addressInfo = {
          name: this.address.name,
          phone: this.address.phone,
          province: this.address.province,
          city: this.address.city,
          area: this.address.area,
          datail: this.address.datail
        }
        if (this.inputIf) {
          addressPhone = this.address.phone + ',' + this.address.phone2
        } else {
          addressPhone = this.address.phone
        }
      } else {
        // console.log(this.referaddress);
        addressInfo = {
          name: this.referaddress.userName,
          phone: this.referaddress.phone,
          province: this.referaddress.provinceCode,
          city: this.referaddress.cityCode,
          area: this.referaddress.regionCode,
          datail: this.referaddress.detailedAddress
        }
        if (this.inputIf) {
          addressPhone =
            tthis.referaddress.phone + ',' + this.referaddress.phone2
        } else {
          addressPhone = this.referaddress.phone
        }
      }
      // 地址选择处理
      if (
        !this.is_null(addressInfo.name) &&
        !this.is_null(addressInfo.phone) &&
        this.judgeIsNum(addressInfo.phone) &&
        !this.is_null(addressInfo.datail) &&
        this.form.intention &&
        addressInfo.phone.trim().length == 11
      ) {
        if (this.$route.query.exchange === 1) {
          if (this.form.Incoming) {
            this.axios
              .post('/order/order/return/addneworder', {
                // "addressId": this.address.addressId,
                addressName: addressInfo.name,
                addressPhone: addressPhone,
                // address:this.address.province+this.address.city+this.address.area+this.address.datail,
                detailedAddress: addressInfo.datail,
                province: addressInfo.province,
                city: addressInfo.city,
                region: addressInfo.area,
                charge: 0,
                createdBy: sessionStorage.getItem('user_id'),
                isChange: '', // 是否改单
                money: this.total,
                receivedMoney: this.receivedMoney,
                orderCommodityAdds: goods, // 商品列表
                orderComplimentaryAdds: gift,
                pieceNumber: this.orderNumber, // 总件数
                total: this.total,
                type: JSON.parse(
                  sessionStorage.getItem('salesAuthorityId').split(',')
                ),
                parentOrderId: this.$route.query.orderId,
                userDitch: this.form.Incoming,
                ditchTime: this.form.ditchTime,
                userId: this.customerId, // 用户id
                isManager: this.isManager, // 0 否 1是经理
                comment: this.textarea,
                userIntention: this.form.intention,
                userDitch: this.form.userDitch
              })
              .then((res) => {
                this.$router.go(-2)
              })
          } else {
            this.$message.warning('请选择入线方式')
          }
        } else {
          if (this.form.Incoming) {
            this.axios
              .post('/order/order/user/add', {
                // "addressId": this.address.addressId,
                addressName: addressInfo.name,
                addressPhone: addressPhone,
                // address:this.address.province+this.address.city+this.address.area+this.address.datail,
                detailedAddress: addressInfo.datail,
                province: addressInfo.province,
                city: addressInfo.city,
                region: addressInfo.area,
                charge: 0,
                createdBy: sessionStorage.getItem('user_id'),
                isChange: '', // 是否改单
                money: this.total,
                receivedMoney: this.receivedMoney,
                orderCommodityAdds: goods, // 商品列表
                orderComplimentaryAdds: gift,
                pieceNumber: this.orderNumber, // 总件数
                total: this.total,
                type: JSON.parse(
                  sessionStorage.getItem('salesAuthorityId').split(',')
                ),
                userDitch: this.form.Incoming,
                ditchTime: this.form.ditchTime,
                userId: this.customerId, // 用户id
                isManager: this.isManager, // 0 否 1是经理
                comment: this.textarea,
                userIntention: this.form.intention,
                userDitch: this.form.userDitch,
                channelOrderId: this.channelOrderId
              })
              .then((res) => {
                // console.log(res);
                if (res.code == 0) {
                  this.$message.success('提交成功')
                  sessionStorage.removeItem('goodsList')
                  sessionStorage.removeItem('giftList')
                  sessionStorage.removeItem('voucher')
                  if (
                    JSON.parse(sessionStorage.getItem('salesAuthorityId')) == 2
                  ) {
                    this.$router.replace({
                      name: 'orderList',
                      query: {
                        activeName: '0'
                      }
                    })
                  } else {
                    this.$router.replace({
                      name: 'orderList',
                      query: {
                        activeName: '3'
                      }
                    })
                  }
                } else {
                  this.$message.error(res.message)
                }
              })
          } else {
            this.$message.warning('请选择入线方式')
          }
        }
      } else {
        if (!addressInfo.name) {
          this.$message.error('收货人姓名不能为空~')
        } else if (!addressInfo.datail) {
          this.$message.error('收货地址不能空~')
        } else if (
          addressInfo.phone.length != 11 ||
          !this.judgeIsNum(addressInfo.phone)
        ) {
          this.$message.error('收货电话不正确')
        } else if (!this.form.intention) {
          this.$message.error('请选择客户意向~')
        }
        // else if (!addressClass) {
        //   this.$message.error("电话2号码不正确");
        // }
      }
    },

    // 改单数据提交

    trueOrderTips () {
      if (
        JSON.parse(sessionStorage.getItem('salesAuthorityId').split(',')) == '1'
      ) {
        this.$confirm(
          '客户意向：' +
          this.intention.find((res) => res.id == this.form.intention).name,
          '请确认您的订单信息',
          {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }
        )
          .then(() => {
            this.trueOrder()
          })
          .catch(() => {
            this.$message({
              type: 'info',
              message: '已取消提交'
            })
          })
      } else {
        this.trueOrder()
      }
    },

    trueOrder: _.debounce(function () {
      const goods = []
      for (let i = 0; i < this.tableData.length; i++) {
        const content = {
          commodityId: this.tableData[i].id,
          createdBy: sessionStorage.getItem('user_id'),
          createdTime: '',
          number: Number(this.tableData[i].number),
          orderId: '',
          sellPrice: this.tableData[i].sellPrice,
          total: this.tableData[i].total
        }
        goods.push(content)
      }
      // 赠品列表
      const gift = []
      if (!this.is_null(this.tableZp)) {
        for (let i = 0; i < this.tableZp.length; i++) {
          const contentGift = {
            complimentaryId: this.tableZp[i].id,
            createdBy: sessionStorage.getItem('user_id'),
            createdTime: '',
            number: Number(this.tableZp[i].number),
            orderId: '',
            sellPrice: this.tableZp[i].sellPrice,
            total: this.tableZp[i].total
          }
          gift.push(contentGift)
        }
      }
      // 凭证图片处理
      var updateImage = []
      const fileList = JSON.parse(JSON.stringify(this.fileList))
      for (let k = 0; k < fileList.length; k++) {
        updateImage.push(fileList[k].img)
      }
      // 凭证图片处理

      // 地址选择处理
      let addressInfo = {
        name: '',
        phone: '',
        datail: '',
        province: '',
        city: '',
        area: '',
        datail: ''
      }

      if (!this.temporary) {
        addressInfo = {
          name: this.address.name,
          phone: this.address.phone,
          province: this.address.province,
          city: this.address.city,
          area: this.address.area,
          datail: this.address.datail
        }
      } else {
        addressInfo = {
          name: this.referaddress.userName,
          phone: this.referaddress.phone,
          province: this.referaddress.provinceCode,
          city: this.referaddress.cityCode,
          area: this.referaddress.regionCode,
          datail: this.referaddress.datail
        }
      }
      // 地址选择处理

      if (
        !this.is_null(addressInfo.name) &&
        !this.is_null(addressInfo.phone) &&
        !this.is_null(addressInfo.province) &&
        !this.is_null(addressInfo.city) &&
        !this.is_null(addressInfo.datail) &&
        addressInfo.phone.trim().length == 11
      ) {
        // ----------待付款的修改
        if (this.is_null(sessionStorage.getItem('paid'))) {
          this.axios
            .post('/order/order/change/orderChange', {
              // "addressId": this.addressId,
              addressName: addressInfo.name,
              addressPhone: addressInfo.phone,
              detailedAddress: addressInfo.datail,
              province: addressInfo.province,
              city: addressInfo.city,
              region: addressInfo.area,
              // address:this.address.province+this.address.city+this.address.area+this.address.datail,
              charge: 0, // 运费
              // createdBy: "",
              isChange: 1, // 是否改单--------------
              money: this.total,
              orderCommodityUpdates: goods, // 商品列表
              orderComplimentaryUpdates: gift,
              pieceNumber: this.orderNumber, // 总件数
              total: this.total,
              taskId: this.taskId, // ---------------
              type: JSON.parse(
                sessionStorage.getItem('salesAuthorityId').split(',')
              ),
              updateImage: updateImage,
              comment: this.textarea,
              userDitch: this.form.Incoming,
              ditchTime: this.form.ditchTime,
              userIntention: this.form.intention,
              updatedBy: sessionStorage.getItem('user_id'),
              userId: this.customerId, // 用户id
              orderId: this.orderId,
              receivedMoney: this.receivedMoney,
              isCommit: this.$route.query.isCommit
            })
            .then((res) => {
              // console.log(res);
              if (res.code == 0) {
                this.$message.success('改单成功')
                sessionStorage.removeItem('goodsList')
                sessionStorage.removeItem('giftList')
                sessionStorage.removeItem('voucher')
                this.$router.replace({
                  name: 'orderList',
                  query: {
                    activeName: '3'
                  }
                })
              } else {
                this.$message.error(res.message)
              }
            })
        } else {
          this.axios
            .post('/order/order/change/orderChangeKefu', {
              // "addressId": this.addressId,
              addressName: addressInfo.name,
              addressPhone: addressInfo.phone,
              detailedAddress: addressInfo.datail,
              province: addressInfo.province,
              city: addressInfo.city,
              region: addressInfo.area,
              // address:this.address.province+this.address.city+this.address.area+this.address.datail,
              charge: 0, // 运费
              createdBy: '',
              isChange: 1, // 是否改单--------------
              money: this.total,
              orderCommodityUpdates: goods, // 商品列表
              orderComplimentaryUpdates: gift,
              pieceNumber: this.orderNumber, // 总件数
              total: this.total,
              taskId: this.taskId,
              isManager: this.isManager,
              type: JSON.parse(
                sessionStorage.getItem('salesAuthorityId').split(',')
              ),
              updateImage: updateImage,
              comment: this.textarea,
              userDitch: this.form.Incoming,
              ditchTime: this.form.ditchTime,
              updatedBy: sessionStorage.getItem('user_id'),
              userId: this.customerId, // 用户id
              orderId: this.orderId,
              receivedMoney: this.receivedMoney
            })
            .then((res) => {
              // console.log(res);
              if (res.code == 0) {
                this.$message.success('改单成功')
                sessionStorage.removeItem('goodsList')
                sessionStorage.removeItem('giftList')
                sessionStorage.removeItem('voucher')
                sessionStorage.removeItem('paid')
                this.$router.replace({
                  name: 'orderList',
                  query: {
                    activeName: '1'
                  }
                })
              } else {
                this.$message.error(res.message)
              }
            })
        }
      } else {
        this.$message.error('收货地址信息不正确~')
      }
    }, 300),
    // 删除
    delectRow (index) {
      this.tableData.splice(index, 1)
      this.calculation()
    },
    delectRowZp (index) {
      this.tableZp.splice(index, 1)
      this.calculation()
    },
    calculation () {
      let zpNum = 0
      let numb = 0
      let zpPrice = 0
      let price = 0
      for (let i = 0; i < this.tableZp.length; i++) {
        zpNum += Number(this.tableZp[i].number)
        zpPrice += this.tableZp[i].number * this.tableZp[i].sellPrice
      }
      for (let i = 0; i < this.tableData.length; i++) {
        numb += Number(this.tableData[i].number)
        price += this.tableData[i].number * this.tableData[i].sellPrice
      }
      this.orderNumber = numb + zpNum
      this.origTotal = parseFloat(price + zpPrice)
      this.total = this.origTotal
    },
    //* * 普通数据请求 **//
    commentAxios () {
      // 入线方式
      this.axios
        .get('/order/comm/customeruser/selectCustomerditch', {
          headers: {
            isLoading: false
          }
        })
        .then((res) => {
          // console.log(res)
          if (res.code == 0) {
            this.line = res.data
          } else {
            this.$message.error(res.message)
          }
        })
      /* 意向*/
      this.axios
        .post(
          "/order/comm/customeruser/selectCustomerintention",
          {
            salesAuthorityId: JSON.parse(
              sessionStorage.getItem('salesAuthorityId')
            )
          },
          {
            headers: {
              isLoading: false
            }
          }
        )
        .then((res) => {
          console.log(res, "客户意向")
          if (res.code == 0) {
            this.intention = res.data
          } else {
            this.$message.error(res.message)
          }
        })
      /* 等级*/
      this.axios
        .get('/order/comm/customeruser/selectCustomerlevel', {
          headers: {
            isLoading: false
          }
        })
        .then((res) => {
          // console.log(res)
          if (res.code == 0) {
            this.rank = res.data
          } else {
            this.$message.error(res.message)
          }
        })
    },
    // 修改地址
    fixAddress () {
      // if(this.is_null(JSON.parse(sessionStorage.getItem('voucher')))){
      // 	this.notesEvent();
      // }
      this.$router.push({
        name: 'addressList',
        query: {
          isChange: 2,
          isTab: 1,
          id: this.customerId,
          taskId: this.taskId,
          orderId: this.orderId,
          total: this.total,
          receivedMoney: this.receivedMoney,
          userIntention: this.form.intention,
          userDitch: this.form.userDitch
        }
      })
    },
    // 跳转客户资料
    toInformation () {
      this.$router.push('/customerInformation')
    },
    // 加减号
    changeQuantity (row, type) {
      if (type > 0) {
        row.number++
      } else {
        row.number--
        row.number > 1 ? row.number : (row.number = 1)
      }
      this.changeCount(row)
    },
    // 数量文本框值改变
    changeCount (row) {
      if (row.number == null || row.number == '') {
        row.number = 1
      } else if (row.number == 1) {
        this.$message({
          message: '已经减到最低了哦',
          type: 'warning'
        })
      }
    },
    is_null (content) {
      if (content) {
        return false
      } else {
        return true
      }
    },
    getProvince (val) {
      this.address.province = val
      this.address.city = ''
      this.address.area = ''
    },
    getCity (val) {
      this.address.city = val
      this.address.area = ''
    },
    getArea (val) {
      this.address.area = val
    },

    getProvince1 (val) {
      this.addressDialog.province = val
      this.addressDialog.city = ''
      this.addressDialog.area = ''
    },
    getCity1 (val) {
      this.addressDialog.city = val
      this.addressDialog.area = ''
    },
    getArea1 (val) {
      this.addressDialog.area = val
    }
  }
}
</script>

<style scoped lang="scss">
/deep/.el-table__header {
  width: 100% !important;
}
/deep/.el-table__body {
  width: 100% !important;
}
.div1 {
  margin-left: -16px;
  background: url(../../assets/breadcrumb2.png);
  width: 120px;
  height: 30px;
  text-align: center;
  line-height: 30px;
  color: #2d7edf;
}

.div2 {
  margin-left: -16px;
  background: url(../../assets/breadcrumb1.png);
  width: 120px;
  height: 30px;
  text-align: center;
  line-height: 30px;
  color: #fff;
}

.div3 {
  margin-left: -8px;
  background: url(../../assets/breadcrumb3.png);
  width: 120px;
  height: 30px;
  text-align: center;
  line-height: 30px;
  color: #2d7edf;
}

.table {
  margin-top: 20px;
}

.col {
  margin-top: 10px;
}

.gift {
  span {
    color: #ff0000;
  }
}

/deep/.el-table .has-gutter .is-leaf {
  color: #2d7edf;
  text-align: center;
}

/deep/.el-table td,
.el-table th {
  text-align: center;
}

.basic {
  background: #fff;
  padding: 10px;
  position: relative;
  .infoShow {
    position: absolute;
    top: -5px;
    right: 0;
    z-index: 10;
    width: 32px;
    height: 32px;
    img {
      width: 32px;
      height: 32px;
    }
  }
}

.receipt {
  padding: 10px;
  background: #fff;
  margin-top: 20px;
}

/deep/.address .el-input__inner {
  width: 300px;
}

/deep/.el-input__inner {
  width: 200px;
  height: 30px;
  line-height: 30px;
}

/deep/.distpicker-address-wrapper select {
  padding: 0rem 0.75rem;
  height: 30px;
  line-height: 30px;
  font-size: 15px;
}

.query {
  background: #fff;
  padding: 10px;
}

/deep/.el-form-item {
  display: inline-block;
  margin-bottom: 0px;
}

.header {
  display: flex;
  justify-content: space-between;
  // padding-bottom: 10px;
  span {
    font-size: 15px;
    color: #444;
    font-weight: 600;
  }
  p {
    font-size: 12px;
    color: #2d7edf;
  }
  p:hover {
    cursor: pointer;
  }
}
/deep/ .query .el-input__inner {
  width: 180px;
}

.selectDate {
  display: inline-block;
  margin-right: 20px;

  span {
    display: inline-block;
    font-size: 15px;
    margin-right: 15px;
    vertical-align: middle;
  }

  .picker {
    display: inline-block;
    vertical-align: middle;
  }

  /deep/.el-input__inner {
    width: 250px;
    height: 28px;
    line-height: 28px;
  }

  /deep/ .el-date-editor .el-range__icon {
    line-height: 23px;
  }

  /deep/ .el-date-editor .el-range-separator {
    line-height: 23px;
  }

  /deep/.el-date-editor .el-range__close-icon {
    line-height: 22px;
  }
}

.operation {
  float: left;
  margin-left: 20px;

  img {
    width: 25px;
    height: 25px;
  }
}

.table {
  /deep/.el-table td,
  .el-table th {
    text-align: center;
  }

  /deep/ .el-table th > .cell {
    text-align: center;
    color: rgb(45, 125, 223);
    font-size: 15px;
  }

  /deep/.el-table__row:hover {
    color: rgb(45, 125, 223);
  }

  /deep/.el-button {
    padding: 0px;
    height: 30px;
    width: 80px;
  }
}

.orderBox {
  position: relative;
  margin-top: 20px;
  padding-bottom: 10px;

  .page1 {
    margin-top: 10px;
    background: #fff;
    padding: 10px;
    text-align: right;

    p {
      display: inline-block;
      vertical-align: middle;
      text-align: center;
    }

    /deep/ .el-input {
      display: inline-block;
      vertical-align: middle;
      width: 130px;
    }

    /deep/ .el-input__inner {
      width: 120px;
      color: #2d7edf;
    }

    span {
      font-size: 14px;
      color: #2d7edf;
      display: inline-block;
      margin-left: 10px;
      vertical-align: middle;
    }
  }
}

.numer {
  /deep/.el-button {
    padding: 5px;
    margin: 0;
    background: #fff;
    border: 1px solid transparent;
    height: 23px;
    font-size: 10px;
    // width:30px;
    border-radius: 0;
  }

  /deep/.el-input-group__prepend {
    padding: 0;
    border-radius: 0;
    border: 1px solid transparent;
  }

  /deep/ .el-input-group {
    width: 80px;
  }

  /deep/.el-input-group__append {
    padding: 0;
    border-radius: 0;
    border: 1px solid transparent;
    // background: #fff;
  }

  /deep/.el-input__inner {
    width: 30px;
    text-align: center;
    padding: 0;
    margin: 0 5px;
    height: 25px;
    line-height: 25px;
  }
}

.orderNotes {
  padding: 10px;
  background: #fff;
  margin-bottom: 10px;
}

.notes {
  p {
    margin-top: 10px;
    display: inline-block;
    margin-right: 10px;
    position: relative;

    img {
      width: 100px;
      height: 100px;
    }
  }

  span {
    display: block;
    width: 18px;
    height: 18px;
    line-height: 20px;
    text-align: center;
    font-size: 13px;
    color: #fff;
    background: #409eff;
    position: absolute;
    top: -5px;
    right: -6px;
    border-radius: 50%;
  }
}
.input1 {
  /deep/.el-input {
    width: 200px;
    margin-right: 10px;
  }
}
.addList {
  /deep/.el-radio-group {
    width: 100%;
    font-size: 14px;
  }
  /deep/.el-radio__label {
    width: 100%;
  }
  /deep/.el-radio {
    display: flex;
    align-items: center;
    width: 100%;
  }
}
.radioCont {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
/deep/.el-dialog__header {
  // background: #2d7edf;
  padding: 10px 20px 10px;
}
/deep/.el-dialog__body {
  padding: 10px 20px;
}
/deep/.el-dialog__headerbtn {
  top: 12px;
}
.submitAddress {
  margin-top: 15px;
  font-size: 14px;
  color: #333;
  > p {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    span {
      display: inline-block;
      margin-right: 10px;
    }
  }
  .lingshi {
    margin-top: 10px;
    span {
      color: #2d7edf;
      display: inline-block;
      vertical-align: middle;
      margin-right: 15px;
    }
    span:hover {
      cursor: pointer;
    }
  }
}
</style>
